package com.common.security.exceptions;

import com.common.security.abstracts.AbstractException;

/**
 * Error code range: 1021 - 1040
 * 
 * @author Ady
 *
 */
public class DatabaseException extends AbstractException {
	
	private static final long serialVersionUID = 1L;
	
	public static final int DATABASE_EXCEPTION = 1021;
	private static final String MESSAGE_DATABASE_EXCEPTION = "Unable to access the database";
	
	public DatabaseException(int code) {
		super(code, getMessage(code));
	}
	
	private static String getMessage(int code) {
		switch (code) {
			case DATABASE_EXCEPTION: {
				return MESSAGE_DATABASE_EXCEPTION;
			}
			default: {
				return MESSAGE_ERROR_NOT_FOUND;
			}
		}
	}
}
